<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:r2mlv="http://www.rewerse.net/I1/2006/R2ML/R2MLV" targetNamespace="http://www.rewerse.net/I1/2006/R2ML/R2MLV" elementFormDefault="qualified" attributeFormDefault="qualified" xml:lang="en">
 <xs:include schemaLocation="r2mlv-basic.xsd"/>
 <xs:element name="EnumerationDatatype" type="r2mlv:EnumerationDatatype" substitutionGroup="r2mlv:Datatype"/>
 <xs:element name="Function" type="r2mlv:Function" abstract="true" substitutionGroup="r2mlv:VocabularyEntry"/>
 <xs:element name="GenericFunction" type="r2mlv:GenericFunction" substitutionGroup="r2mlv:Function"/>
 <xs:element name="DatatypeFunction" type="r2mlv:DatatypeFunction" substitutionGroup="r2mlv:Function"/>
 <xs:element name="Operation" type="r2mlv:Operation" abstract="false" substitutionGroup="r2mlv:Function"/>
 <xs:element name="DataOperation" type="r2mlv:DataOperation" substitutionGroup="r2mlv:Operation"/>
 <xs:element name="ObjectOperation" type="r2mlv:ObjectOperation" substitutionGroup="r2mlv:Operation"/>
 <xs:element name="contextType" type="r2mlv:contextType"/>
 <xs:element name="returnType" type="r2mlv:returnType"/>
 <!--
EnumerationDatatype
-->
 <xs:complexType name="EnumerationDatatype">
  <xs:complexContent>
   <xs:extension base="r2mlv:Datatype"/>
   <!-- <xs:sequence>
     <xs:element ref="rdfs:Literal" maxOccurs="unbounded"/>
     </xs:sequence> -->
  </xs:complexContent>
 </xs:complexType>
 <!--
Function
-->
 <xs:complexType name="Function">
  <xs:complexContent>
   <xs:extension base="r2mlv:VocabularyEntry">
    <xs:sequence>
     <xs:element ref="r2mlv:argumentsType" minOccurs="0"/>
     <xs:element ref="r2mlv:ap" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute ref="r2mlv:arity"/>
   </xs:extension>
  </xs:complexContent>
 </xs:complexType>
 <!--
GenericFunction
-->
 <xs:complexType name="GenericFunction">
  <xs:complexContent>
   <xs:extension base="r2mlv:Function"/>
  </xs:complexContent>
 </xs:complexType>
 <!-- 
DatatypeFunction
-->
 <xs:complexType name="DatatypeFunction">
  <xs:complexContent>
   <xs:extension base="r2mlv:Function"/>
  </xs:complexContent>
 </xs:complexType>
 <!-- Operation -->
 <xs:complexType name="Operation">
  <xs:complexContent>
   <xs:extension base="r2mlv:Function">
    <xs:sequence minOccurs="0">
     <xs:element ref="r2mlv:contextType"/>
     <xs:element ref="r2mlv:returnType"/>
    </xs:sequence>
   </xs:extension>
  </xs:complexContent>
 </xs:complexType>
 <!--
DataOperation
-->
 <xs:complexType name="DataOperation">
  <xs:complexContent>
   <xs:extension base="r2mlv:Operation"/>
  </xs:complexContent>
 </xs:complexType>
 <!--
ObjectOperation
-->
 <xs:complexType name="ObjectOperation">
  <xs:complexContent>
   <xs:extension base="r2mlv:Operation"/>
  </xs:complexContent>
 </xs:complexType>
 <!-- 
contextType
 -->
 <xs:complexType name="contextType">
  <xs:sequence>
   <xs:element ref="r2mlv:Class"/>
  </xs:sequence>
 </xs:complexType>
 <!-- 
returnType
 -->
 <xs:complexType name="returnType">
  <xs:choice>
   <xs:element ref="r2mlv:Class"/>
   <xs:element ref="r2mlv:Datatype"/>
  </xs:choice>
 </xs:complexType>
 <!-- attributes -->
 <xs:attribute name="ap" type="xs:string"/>
</xs:schema>
